import { cookies } from 'next/headers'

import { mock, MockResponse } from '@/utils/mock'

import { User } from '../models/UserModel'
class UserApi {
  getUser(): Promise<MockResponse<User>> {
    const cookieStore = cookies()
    const token = cookieStore.get('token')
    console.log('token', token?.value)
    if (!token?.value) return mock('no token', false)
    return mock({
      id: '111',
      name: 'renzhao',
      status: 1,
    })
  }
}

export default new UserApi()
